package fr.cdj.thebox.server;

import java.io.FileNotFoundException;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

import fr.cdj.thebox.client.services.FileService;
import fr.cdj.thebox.server.generated.GeneratedConf;
import fr.cdj.thebox.shared.FileList;

public class FileServiceImpl extends RemoteServiceServlet implements FileService {

	private static final long serialVersionUID = -4548167385862822185L;

	@Override
	public FileList listFiles(String path) {
		GeneratedConf gConf = XmlLoader.generateConfFromXmlFile();
		FileManager fm = new FileManager(gConf);
		try {
			return fm.list(path);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		return null;
	}

}
